{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "40f7faf7-2760-450b-a6a3-72b320077088",
   "metadata": {},
   "outputs": [],
   "source": [
    "import fiftyone.zoo as foz\n",
    "import fiftyone as fo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "50ca1997-5950-4398-b0d5-3f3cd01a5c6e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading split 'validation' to '/home/luoluoluo/fiftyone/open-images-v7/validation' if necessary\n",
      "Downloading 100 images\n",
      " 100% |███████████████████| 100/100 [8.8s elapsed, 0s remaining, 16.0 files/s]      \n",
      "Dataset info written to '/home/luoluoluo/fiftyone/open-images-v7/info.json'\n",
      "Loading existing dataset 'open-images-v7-validation-100'. To reload from disk, either delete the existing dataset or provide a custom `dataset_name` to use\n"
     ]
    }
   ],
   "source": [
    "dataset = foz.load_zoo_dataset(\n",
    "              \"open-images-v7\",\n",
    "              split=\"validation\",\n",
    "              label_types=[\"detections\",\"segmentations\"],\n",
    "              classes=[\"Man\"],\n",
    "              max_samples=100,\n",
    "          )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "eb959f3d-790a-4d49-9946-e8155a2ea297",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Accordion',\n",
       " 'Adhesive tape',\n",
       " 'Aircraft',\n",
       " 'Airplane',\n",
       " 'Alarm clock',\n",
       " 'Alpaca',\n",
       " 'Ambulance',\n",
       " 'Animal',\n",
       " 'Ant',\n",
       " 'Antelope',\n",
       " 'Apple',\n",
       " 'Armadillo',\n",
       " 'Artichoke',\n",
       " 'Auto part',\n",
       " 'Axe',\n",
       " 'Backpack',\n",
       " 'Bagel',\n",
       " 'Baked goods',\n",
       " 'Balance beam',\n",
       " 'Ball',\n",
       " 'Balloon',\n",
       " 'Banana',\n",
       " 'Band-aid',\n",
       " 'Banjo',\n",
       " 'Barge',\n",
       " 'Barrel',\n",
       " 'Baseball bat',\n",
       " 'Baseball glove',\n",
       " 'Bat (Animal)',\n",
       " 'Bathroom accessory',\n",
       " 'Bathroom cabinet',\n",
       " 'Bathtub',\n",
       " 'Beaker',\n",
       " 'Bear',\n",
       " 'Bed',\n",
       " 'Bee',\n",
       " 'Beehive',\n",
       " 'Beer',\n",
       " 'Beetle',\n",
       " 'Bell pepper',\n",
       " 'Belt',\n",
       " 'Bench',\n",
       " 'Bicycle',\n",
       " 'Bicycle helmet',\n",
       " 'Bicycle wheel',\n",
       " 'Bidet',\n",
       " 'Billboard',\n",
       " 'Billiard table',\n",
       " 'Binoculars',\n",
       " 'Bird',\n",
       " 'Blender',\n",
       " 'Blue jay',\n",
       " 'Boat',\n",
       " 'Bomb',\n",
       " 'Book',\n",
       " 'Bookcase',\n",
       " 'Boot',\n",
       " 'Bottle',\n",
       " 'Bottle opener',\n",
       " 'Bow and arrow',\n",
       " 'Bowl',\n",
       " 'Bowling equipment',\n",
       " 'Box',\n",
       " 'Boy',\n",
       " 'Brassiere',\n",
       " 'Bread',\n",
       " 'Briefcase',\n",
       " 'Broccoli',\n",
       " 'Bronze sculpture',\n",
       " 'Brown bear',\n",
       " 'Building',\n",
       " 'Bull',\n",
       " 'Burrito',\n",
       " 'Bus',\n",
       " 'Bust',\n",
       " 'Butterfly',\n",
       " 'Cabbage',\n",
       " 'Cabinetry',\n",
       " 'Cake',\n",
       " 'Cake stand',\n",
       " 'Calculator',\n",
       " 'Camel',\n",
       " 'Camera',\n",
       " 'Can opener',\n",
       " 'Canary',\n",
       " 'Candle',\n",
       " 'Candy',\n",
       " 'Cannon',\n",
       " 'Canoe',\n",
       " 'Cantaloupe',\n",
       " 'Car',\n",
       " 'Carnivore',\n",
       " 'Carrot',\n",
       " 'Cart',\n",
       " 'Cassette deck',\n",
       " 'Castle',\n",
       " 'Cat',\n",
       " 'Cat furniture',\n",
       " 'Caterpillar',\n",
       " 'Cattle',\n",
       " 'Ceiling fan',\n",
       " 'Cello',\n",
       " 'Centipede',\n",
       " 'Chainsaw',\n",
       " 'Chair',\n",
       " 'Cheese',\n",
       " 'Cheetah',\n",
       " 'Chest of drawers',\n",
       " 'Chicken',\n",
       " 'Chime',\n",
       " 'Chisel',\n",
       " 'Chopsticks',\n",
       " 'Christmas tree',\n",
       " 'Clock',\n",
       " 'Closet',\n",
       " 'Clothing',\n",
       " 'Coat',\n",
       " 'Cocktail',\n",
       " 'Cocktail shaker',\n",
       " 'Coconut',\n",
       " 'Coffee',\n",
       " 'Coffee cup',\n",
       " 'Coffee table',\n",
       " 'Coffeemaker',\n",
       " 'Coin',\n",
       " 'Common fig',\n",
       " 'Common sunflower',\n",
       " 'Computer keyboard',\n",
       " 'Computer monitor',\n",
       " 'Computer mouse',\n",
       " 'Container',\n",
       " 'Convenience store',\n",
       " 'Cookie',\n",
       " 'Cooking spray',\n",
       " 'Corded phone',\n",
       " 'Cosmetics',\n",
       " 'Couch',\n",
       " 'Countertop',\n",
       " 'Cowboy hat',\n",
       " 'Crab',\n",
       " 'Cream',\n",
       " 'Cricket ball',\n",
       " 'Crocodile',\n",
       " 'Croissant',\n",
       " 'Crown',\n",
       " 'Crutch',\n",
       " 'Cucumber',\n",
       " 'Cupboard',\n",
       " 'Curtain',\n",
       " 'Cutting board',\n",
       " 'Dagger',\n",
       " 'Dairy Product',\n",
       " 'Deer',\n",
       " 'Desk',\n",
       " 'Dessert',\n",
       " 'Diaper',\n",
       " 'Dice',\n",
       " 'Digital clock',\n",
       " 'Dinosaur',\n",
       " 'Dishwasher',\n",
       " 'Dog',\n",
       " 'Dog bed',\n",
       " 'Doll',\n",
       " 'Dolphin',\n",
       " 'Door',\n",
       " 'Door handle',\n",
       " 'Doughnut',\n",
       " 'Dragonfly',\n",
       " 'Drawer',\n",
       " 'Dress',\n",
       " 'Drill (Tool)',\n",
       " 'Drink',\n",
       " 'Drinking straw',\n",
       " 'Drum',\n",
       " 'Duck',\n",
       " 'Dumbbell',\n",
       " 'Eagle',\n",
       " 'Earrings',\n",
       " 'Egg (Food)',\n",
       " 'Elephant',\n",
       " 'Envelope',\n",
       " 'Eraser',\n",
       " 'Face powder',\n",
       " 'Facial tissue holder',\n",
       " 'Falcon',\n",
       " 'Fashion accessory',\n",
       " 'Fast food',\n",
       " 'Fax',\n",
       " 'Fedora',\n",
       " 'Filing cabinet',\n",
       " 'Fire hydrant',\n",
       " 'Fireplace',\n",
       " 'Fish',\n",
       " 'Flag',\n",
       " 'Flashlight',\n",
       " 'Flower',\n",
       " 'Flowerpot',\n",
       " 'Flute',\n",
       " 'Flying disc',\n",
       " 'Food',\n",
       " 'Food processor',\n",
       " 'Football',\n",
       " 'Football helmet',\n",
       " 'Footwear',\n",
       " 'Fork',\n",
       " 'Fountain',\n",
       " 'Fox',\n",
       " 'French fries',\n",
       " 'French horn',\n",
       " 'Frog',\n",
       " 'Fruit',\n",
       " 'Frying pan',\n",
       " 'Furniture',\n",
       " 'Garden Asparagus',\n",
       " 'Gas stove',\n",
       " 'Giraffe',\n",
       " 'Girl',\n",
       " 'Glasses',\n",
       " 'Glove',\n",
       " 'Goat',\n",
       " 'Goggles',\n",
       " 'Goldfish',\n",
       " 'Golf ball',\n",
       " 'Golf cart',\n",
       " 'Gondola',\n",
       " 'Goose',\n",
       " 'Grape',\n",
       " 'Grapefruit',\n",
       " 'Grinder',\n",
       " 'Guacamole',\n",
       " 'Guitar',\n",
       " 'Hair dryer',\n",
       " 'Hair spray',\n",
       " 'Hamburger',\n",
       " 'Hammer',\n",
       " 'Hamster',\n",
       " 'Hand dryer',\n",
       " 'Handbag',\n",
       " 'Handgun',\n",
       " 'Harbor seal',\n",
       " 'Harmonica',\n",
       " 'Harp',\n",
       " 'Harpsichord',\n",
       " 'Hat',\n",
       " 'Headphones',\n",
       " 'Heater',\n",
       " 'Hedgehog',\n",
       " 'Helicopter',\n",
       " 'Helmet',\n",
       " 'High heels',\n",
       " 'Hiking equipment',\n",
       " 'Hippopotamus',\n",
       " 'Home appliance',\n",
       " 'Honeycomb',\n",
       " 'Horizontal bar',\n",
       " 'Horse',\n",
       " 'Hot dog',\n",
       " 'House',\n",
       " 'Houseplant',\n",
       " 'Human arm',\n",
       " 'Human beard',\n",
       " 'Human body',\n",
       " 'Human ear',\n",
       " 'Human eye',\n",
       " 'Human face',\n",
       " 'Human foot',\n",
       " 'Human hair',\n",
       " 'Human hand',\n",
       " 'Human head',\n",
       " 'Human leg',\n",
       " 'Human mouth',\n",
       " 'Human nose',\n",
       " 'Humidifier',\n",
       " 'Ice cream',\n",
       " 'Indoor rower',\n",
       " 'Infant bed',\n",
       " 'Insect',\n",
       " 'Invertebrate',\n",
       " 'Ipod',\n",
       " 'Isopod',\n",
       " 'Jacket',\n",
       " 'Jacuzzi',\n",
       " 'Jaguar (Animal)',\n",
       " 'Jeans',\n",
       " 'Jellyfish',\n",
       " 'Jet ski',\n",
       " 'Jug',\n",
       " 'Juice',\n",
       " 'Kangaroo',\n",
       " 'Kettle',\n",
       " 'Kitchen & dining room table',\n",
       " 'Kitchen appliance',\n",
       " 'Kitchen knife',\n",
       " 'Kitchen utensil',\n",
       " 'Kitchenware',\n",
       " 'Kite',\n",
       " 'Knife',\n",
       " 'Koala',\n",
       " 'Ladder',\n",
       " 'Ladle',\n",
       " 'Ladybug',\n",
       " 'Lamp',\n",
       " 'Land vehicle',\n",
       " 'Lantern',\n",
       " 'Laptop',\n",
       " 'Lavender (Plant)',\n",
       " 'Lemon',\n",
       " 'Leopard',\n",
       " 'Light bulb',\n",
       " 'Light switch',\n",
       " 'Lighthouse',\n",
       " 'Lily',\n",
       " 'Limousine',\n",
       " 'Lion',\n",
       " 'Lipstick',\n",
       " 'Lizard',\n",
       " 'Lobster',\n",
       " 'Loveseat',\n",
       " 'Luggage and bags',\n",
       " 'Lynx',\n",
       " 'Magpie',\n",
       " 'Mammal',\n",
       " 'Man',\n",
       " 'Mango',\n",
       " 'Maple',\n",
       " 'Maracas',\n",
       " 'Marine invertebrates',\n",
       " 'Marine mammal',\n",
       " 'Measuring cup',\n",
       " 'Mechanical fan',\n",
       " 'Medical equipment',\n",
       " 'Microphone',\n",
       " 'Microwave oven',\n",
       " 'Milk',\n",
       " 'Miniskirt',\n",
       " 'Mirror',\n",
       " 'Missile',\n",
       " 'Mixer',\n",
       " 'Mixing bowl',\n",
       " 'Mobile phone',\n",
       " 'Monkey',\n",
       " 'Moths and butterflies',\n",
       " 'Motorcycle',\n",
       " 'Mouse',\n",
       " 'Muffin',\n",
       " 'Mug',\n",
       " 'Mule',\n",
       " 'Mushroom',\n",
       " 'Musical instrument',\n",
       " 'Musical keyboard',\n",
       " 'Nail (Construction)',\n",
       " 'Necklace',\n",
       " 'Nightstand',\n",
       " 'Oboe',\n",
       " 'Office building',\n",
       " 'Office supplies',\n",
       " 'Orange',\n",
       " 'Organ (Musical Instrument)',\n",
       " 'Ostrich',\n",
       " 'Otter',\n",
       " 'Oven',\n",
       " 'Owl',\n",
       " 'Oyster',\n",
       " 'Paddle',\n",
       " 'Palm tree',\n",
       " 'Pancake',\n",
       " 'Panda',\n",
       " 'Paper cutter',\n",
       " 'Paper towel',\n",
       " 'Parachute',\n",
       " 'Parking meter',\n",
       " 'Parrot',\n",
       " 'Pasta',\n",
       " 'Pastry',\n",
       " 'Peach',\n",
       " 'Pear',\n",
       " 'Pen',\n",
       " 'Pencil case',\n",
       " 'Pencil sharpener',\n",
       " 'Penguin',\n",
       " 'Perfume',\n",
       " 'Person',\n",
       " 'Personal care',\n",
       " 'Personal flotation device',\n",
       " 'Piano',\n",
       " 'Picnic basket',\n",
       " 'Picture frame',\n",
       " 'Pig',\n",
       " 'Pillow',\n",
       " 'Pineapple',\n",
       " 'Pitcher (Container)',\n",
       " 'Pizza',\n",
       " 'Pizza cutter',\n",
       " 'Plant',\n",
       " 'Plastic bag',\n",
       " 'Plate',\n",
       " 'Platter',\n",
       " 'Plumbing fixture',\n",
       " 'Polar bear',\n",
       " 'Pomegranate',\n",
       " 'Popcorn',\n",
       " 'Porch',\n",
       " 'Porcupine',\n",
       " 'Poster',\n",
       " 'Potato',\n",
       " 'Power plugs and sockets',\n",
       " 'Pressure cooker',\n",
       " 'Pretzel',\n",
       " 'Printer',\n",
       " 'Pumpkin',\n",
       " 'Punching bag',\n",
       " 'Rabbit',\n",
       " 'Raccoon',\n",
       " 'Racket',\n",
       " 'Radish',\n",
       " 'Ratchet (Device)',\n",
       " 'Raven',\n",
       " 'Rays and skates',\n",
       " 'Red panda',\n",
       " 'Refrigerator',\n",
       " 'Remote control',\n",
       " 'Reptile',\n",
       " 'Rhinoceros',\n",
       " 'Rifle',\n",
       " 'Ring binder',\n",
       " 'Rocket',\n",
       " 'Roller skates',\n",
       " 'Rose',\n",
       " 'Rugby ball',\n",
       " 'Ruler',\n",
       " 'Salad',\n",
       " 'Salt and pepper shakers',\n",
       " 'Sandal',\n",
       " 'Sandwich',\n",
       " 'Saucer',\n",
       " 'Saxophone',\n",
       " 'Scale',\n",
       " 'Scarf',\n",
       " 'Scissors',\n",
       " 'Scoreboard',\n",
       " 'Scorpion',\n",
       " 'Screwdriver',\n",
       " 'Sculpture',\n",
       " 'Sea lion',\n",
       " 'Sea turtle',\n",
       " 'Seafood',\n",
       " 'Seahorse',\n",
       " 'Seat belt',\n",
       " 'Segway',\n",
       " 'Serving tray',\n",
       " 'Sewing machine',\n",
       " 'Shark',\n",
       " 'Sheep',\n",
       " 'Shelf',\n",
       " 'Shellfish',\n",
       " 'Shirt',\n",
       " 'Shorts',\n",
       " 'Shotgun',\n",
       " 'Shower',\n",
       " 'Shrimp',\n",
       " 'Sink',\n",
       " 'Skateboard',\n",
       " 'Ski',\n",
       " 'Skirt',\n",
       " 'Skull',\n",
       " 'Skunk',\n",
       " 'Skyscraper',\n",
       " 'Slow cooker',\n",
       " 'Snack',\n",
       " 'Snail',\n",
       " 'Snake',\n",
       " 'Snowboard',\n",
       " 'Snowman',\n",
       " 'Snowmobile',\n",
       " 'Snowplow',\n",
       " 'Soap dispenser',\n",
       " 'Sock',\n",
       " 'Sofa bed',\n",
       " 'Sombrero',\n",
       " 'Sparrow',\n",
       " 'Spatula',\n",
       " 'Spice rack',\n",
       " 'Spider',\n",
       " 'Spoon',\n",
       " 'Sports equipment',\n",
       " 'Sports uniform',\n",
       " 'Squash (Plant)',\n",
       " 'Squid',\n",
       " 'Squirrel',\n",
       " 'Stairs',\n",
       " 'Stapler',\n",
       " 'Starfish',\n",
       " 'Stationary bicycle',\n",
       " 'Stethoscope',\n",
       " 'Stool',\n",
       " 'Stop sign',\n",
       " 'Strawberry',\n",
       " 'Street light',\n",
       " 'Stretcher',\n",
       " 'Studio couch',\n",
       " 'Submarine',\n",
       " 'Submarine sandwich',\n",
       " 'Suit',\n",
       " 'Suitcase',\n",
       " 'Sun hat',\n",
       " 'Sunglasses',\n",
       " 'Surfboard',\n",
       " 'Sushi',\n",
       " 'Swan',\n",
       " 'Swim cap',\n",
       " 'Swimming pool',\n",
       " 'Swimwear',\n",
       " 'Sword',\n",
       " 'Syringe',\n",
       " 'Table',\n",
       " 'Table tennis racket',\n",
       " 'Tablet computer',\n",
       " 'Tableware',\n",
       " 'Taco',\n",
       " 'Tank',\n",
       " 'Tap',\n",
       " 'Tart',\n",
       " 'Taxi',\n",
       " 'Tea',\n",
       " 'Teapot',\n",
       " 'Teddy bear',\n",
       " 'Telephone',\n",
       " 'Television',\n",
       " 'Tennis ball',\n",
       " 'Tennis racket',\n",
       " 'Tent',\n",
       " 'Tiara',\n",
       " 'Tick',\n",
       " 'Tie',\n",
       " 'Tiger',\n",
       " 'Tin can',\n",
       " 'Tire',\n",
       " 'Toaster',\n",
       " 'Toilet',\n",
       " 'Toilet paper',\n",
       " 'Tomato',\n",
       " 'Tool',\n",
       " 'Toothbrush',\n",
       " 'Torch',\n",
       " 'Tortoise',\n",
       " 'Towel',\n",
       " 'Tower',\n",
       " 'Toy',\n",
       " 'Traffic light',\n",
       " 'Traffic sign',\n",
       " 'Train',\n",
       " 'Training bench',\n",
       " 'Treadmill',\n",
       " 'Tree',\n",
       " 'Tree house',\n",
       " 'Tripod',\n",
       " 'Trombone',\n",
       " 'Trousers',\n",
       " 'Truck',\n",
       " 'Trumpet',\n",
       " 'Turkey',\n",
       " 'Turtle',\n",
       " 'Umbrella',\n",
       " 'Unicycle',\n",
       " 'Van',\n",
       " 'Vase',\n",
       " 'Vegetable',\n",
       " 'Vehicle',\n",
       " 'Vehicle registration plate',\n",
       " 'Violin',\n",
       " 'Volleyball (Ball)',\n",
       " 'Waffle',\n",
       " 'Waffle iron',\n",
       " 'Wall clock',\n",
       " 'Wardrobe',\n",
       " 'Washing machine',\n",
       " 'Waste container',\n",
       " 'Watch',\n",
       " 'Watercraft',\n",
       " 'Watermelon',\n",
       " 'Weapon',\n",
       " 'Whale',\n",
       " 'Wheel',\n",
       " 'Wheelchair',\n",
       " 'Whisk',\n",
       " 'Whiteboard',\n",
       " 'Willow',\n",
       " 'Window',\n",
       " 'Window blind',\n",
       " 'Wine',\n",
       " 'Wine glass',\n",
       " 'Wine rack',\n",
       " 'Winter melon',\n",
       " 'Wok',\n",
       " 'Woman',\n",
       " 'Wood-burning stove',\n",
       " 'Woodpecker',\n",
       " 'Worm',\n",
       " 'Wrench',\n",
       " 'Zebra',\n",
       " 'Zucchini']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# with open(\"/home/luoluoluo/data/仓库/small-code/python/数据集下载/a.txt\", \"w\") as f:\n",
    "#     f.write(str(fo.utils.openimages.get_classes()))\n",
    "fo.utils.openimages.get_classes()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "90d27a76-2e80-4190-a02f-d1b54eaedc7a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"100%\"\n",
       "            height=\"800\"\n",
       "            src=\"http://localhost:5151/?notebook=True&subscription=1282bfb5-ef23-47ac-bd93-94fcf78a0e98\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "            \n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.IFrame at 0x7582399ba4c0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "session = fo.launch_app(dataset)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "15c82d11-786e-4924-9c3a-043dc19cc5ae",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
